package polymorphic.exer1;

/**
 * Created with IntelliJ IDEA.
 * ClassName: Circle
 * Package: polymorphic.exer1
 * Description:
 * User: fzykd
 *
 * @Author: LQH
 * Date: 2023-11-22
 * Time: 21:09
 */

public class Circle extends GeometricObject{

    //报错是因为默认自带空参构造器 但是父类 没有空参构造器

    //半径
    private double radius;

    public Circle(String color, double weight, double radius) {
        super(color, weight);
        this.radius = radius;
    }

    @Override
    public double findArea() {
        return 3.14 * radius *radius;
    }

    public double getRadius() {
        return radius;
    }

    public void setRadius(double radius) {
        this.radius = radius;
    }
}
